<template>
    <fieldset>
        <legend>开始努力写代码了</legend>
        <ul>
            <li v-for="(item,index)  in arr" :key='item' >{{item.value}}<button @click="del(index)">删除</button></li>
        </ul>
        <input type="text" ref="ipt" v-model="content">
        <button @click="handclick">提交</button>
    </fieldset>
</template>
<script setup>
import{ ref,}from "vue"
let arr = ref([]);
let content =""
let handclick =function(){
    let obj ={
        value:content
    }
    arr.value.push(obj)
    console.log(arr.value);
}
let del =function(index){
    arr.value.splice(index,1)
}

</script>














